package com.bjc.controller;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @program: servlet
 * @description:
 * @author: bjc
 * @create: 2021-08-18 20:46
 */
public class ThreeServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //设置响应头的content-type  设置为text/html 才能将输出结果解析为html
        resp.setContentType("text/html;charset=utf-8");
        String result = "java<br/>mysql<br/>linux";
        String content = "张三李四王五";
        PrintWriter writer = resp.getWriter();
        writer.println(result);
        writer.println(content);
    }
}
